package cn.script.game.dup;

import cn.script.call_api.AfterApi;
import cn.script.call_api.BeforeApi;
import cn.script.game.GameOpt;
import cn.script.game.prof.Pi;
import cn.script.util.Delay;

/**
 * @author 周永波
 */
public class YsDup extends AbstractDup {

    private boolean isBoss;

    public YsDup(Pi pi, GameOpt gameOpt, boolean isBoss) {
        super("众神劫", pi, gameOpt);
        this.isBoss = isBoss;
    }

    @Override
    protected BeforeApi beFore() {
        return () -> {
            this.go.toBack();
            this.go.moveTo("凌霄城").winPoint(449,333).gamePoint(239,191).rPoint(2,2);
            this.go.npc("众神的亡灵");
            this.go.text_click("会员副本传送");
            this.go.text_click("要塞副本");
            Delay.delay(1000);
            return 1;
        };
    }

    @Override
    protected AfterApi after() {
        return null;
    }

    @Override
    public DupInfo dupInfo() {
        DupInfo dupInfo = new DupInfo(this.go, this.optName);
        if (!this.isBoss) {
            dupInfo.dupOpt("魔族护法长老和平火灵(首领)")
                    .a_skills(this.pi.skills())
                    .m_winPoint(248, 310)
                    .m_gamePoint(114, 269)
                    .a_endNum(3)
                    .a_timeOut(5000);

            dupInfo.dupOpt("魔族护法长老和平水灵(首领)")
                    .a_skills(this.pi.skills())
                    .m_winPoint(320, 305)
                    .m_gamePoint(150, 232)
                    .m_rPoint(5, 5)
                    .a_endNum(3)
                    .a_timeOut(5000);

            dupInfo.dupOpt("魔族护法长老和平暗灵(首领)")
                    .a_skills(this.pi.skills())
                    .m_winPoint(336, 287)
                    .m_gamePoint(135, 202)
                    .m_rPoint(5, 5)
                    .a_endNum(3)
                    .a_timeOut(5000);

            dupInfo.dupOpt("魔族护法长老和平毒灵(首领)")
                    .a_skills(this.pi.skills())
                    .m_winPoint(373, 229)
                    .m_gamePoint(95, 124)
                    .m_rPoint(5, 5)
                    .a_endNum(3)
                    .a_timeOut(5000);

            dupInfo.dupOpt("魔族护法长老和平风灵(首领)")
                    .a_skills(this.pi.skills())
                    .m_winPoint(414, 267)
                    .m_gamePoint(150, 141)
                    .m_rPoint(5, 5)
                    .a_endNum(3)
                    .a_timeOut(5000);

            dupInfo.dupOpt("魔族护法长老和平圣灵(首领)")
                    .a_skills(this.pi.skills())
                    .m_winPoint(438, 277)
                    .m_gamePoint(176, 141)
                    .m_rPoint(5, 5)
                    .a_endNum(3)
                    .a_timeOut(5000);
        }
        dupInfo.dupOpt("魔族守将战意(首领)")
                .a_skills(this.pi.skills())
                .m_winPoint(488, 208)
                .m_gamePoint(132, 45)
                .m_rPoint(5, 5)
                .a_endNum(6)
                .a_timeOut(7000);
        return dupInfo;
    }

}
